<?php
if (!defined("IN_OP"))
{
    exit("You can't access this file directly...");
}
$gametype = intval(getvar("gametype"));
$chkGametype = chkGametype($gametype);
switch ($gametype)
{
    case 0 :
        $ui = new UI();
        break;
    default :
        include_once( "class_3d/CheckMode_3d.php" );
        $chk = new CheckMode_3d($curruser['acl'], 1, $gametype);
        $chk->checkShow3dPage();
        unset($chk);
        $ui = new UI_3D();
        $ui->header();
        $ui = new UI_3D(true);
        break;
}
$tpl = new template2();
$myid = getvar("myid");
if ($myid == "")
{
    $ui->showErrorPage("会员资料不足");
}
else
{
    $myid = strval($myid);
}
$acl_name = array("", "会员", "代理商", "总代理", "股东", "大股东");
$psenmode = array();
$i = 0;
while ($i < count($g_gametype_3d))
{
    $psenmode[$i] = $g_gametype_3d[$i]['ch'];
    ++$i;
}
$isAgent = true;
$isAgentHead = "<td nowrap>原最少占成</td>" . ( "<td nowrap>新最少占成</td>" ) . "<td nowrap>原最大占成</td>" . "<td nowrap>新最大占成</td>" . "<td nowrap>原下线可占成</td>" . "<td nowrap>新下线可占成</td>";
$list = "";
$page = intval(getvar("p"));
if ($page == 0)
{
    $page = 1;
}
$rs = getdb("select * from modifybook where account2='{$myid}' order by id desc", $page, 20);
while (!$rs->eof)
{
    $list .= "<tr class=td2>";
    $list .= "<td nowrap>" . date("Y-m-d H:i:s", $rs->f['dt']);
    $isAgent = $rs->f['acl2'] == 1 ? false : true;
    if (5 < $rs->f['acl1'])
    {
        $list .= "<td nowrap align=center>公司";
    }
    else
    {
        $list .= "<td nowrap align=center>" . $acl_name[$rs->f['acl1']];
    }
    $list .= "<td nowrap>" . $rs->f['account1'];
    $list .= "<td nowrap>" . $rs->f['name1'];
    $list .= "<td nowrap align=center>" . $psenmode[$rs->f['percent_mode']];
    if ($isAgent)
    {
        $list .= "<td nowrap align=right>" . $rs->f['percent0_old'];
        $list .= "<td nowrap align=right>" . $rs->f['percent0_new'];
        $list .= "<td nowrap align=right>" . $rs->f['percent1_old'];
        $list .= "<td nowrap align=right>" . $rs->f['percent1_new'];
        $list .= "<td nowrap align=right>" . $rs->f['mpercent_old'];
        $list .= "<td nowrap align=right>" . $rs->f['mpercent_new'];
    }
    $list .= "<td nowrap align=right>" . $rs->f['amount_old'];
    $list .= "<td nowrap align=right>" . $rs->f['amount_new'];
    $modifyAcc = ($rs->f['modify'] == "Admin" || $rs->f['modify'] == "xadmin") ? "系统管理员" : $rs->f['modify'];
    $list .= "<td nowrap>" . $modifyAcc;
    $list .= "</tr>";
    $rs->movenext();
}
$rs->close();
$url = "op.php?op=agent&fp=mymodify&gametype={$gametype}&myid={$myid}&p=";
if ($page == 1)
{
    $button = "第一页 &nbsp; 上一页 &nbsp; <a href=\"" . $url . "2\">下一页</a> &nbsp; <a href=\"" . $url . $rs->totalpages . "\">最後页</a>";
}
else if ($page == $rs->totalpages)
{
    $button = "<a href=\"" . $url . "1\">第一页</a> &nbsp; <a href=\"" . $url . ( $page - 1 ) . "\">上一页</a> &nbsp; 下一页 &nbsp; 最後页";
}
else
{
    $button = "<a href=\"" . $url . "1\">第一页</a> &nbsp; <a href=\"" . $url . ( $page - 1 ) . "\">上一页</a> &nbsp; <a href=\"" . $url . "2\">下一页</a> &nbsp; <a href=\"" . $url . $rs->totalpages . "\">最後页</a>";
}
$tpl->load("main", "mymodify.htm");
$tpl->set("gametype", $gametype);
if ($isAgent)
{
    $tpl->set("isagent", $isAgentHead);
}
$tpl->set("button", $button);
$tpl->set("list", $list);
$tpl->show("main");
echo "</td></tr></table>";
$ui->footer();
?>